function [ results_fnames ] = osl_run_first_level( oat )

% [ results_fnames ] = osl_run_first_level( oat )
%
% takes in an OAT, which needs to be setup by calling oat=osl_setup_oat(S), struct
% and runs first level analysis
%
% This function should normally be called using osl_run_oat(oat);
%
% MWW 2011

global OSLDIR;

if(~oat.first_level.is_epoched),    

    results_fnames = osl_run_first_level_continuous_hmm(oat); % Do time-wise analysis        

else
    
    if(isfield(oat.first_level,'connectivity_seed_mni_coord') && ~isempty(oat.first_level.connectivity_seed_mni_coord)),    
        results_fnames = osl_run_first_level_epoched_connectivity(oat); 
    else
        results_fnames = osl_run_first_level_epoched_hmm(oat); % Do trial-wise analysis    
    end;
end;
